package com.snailcatmall.www.controller;

import com.snailcatmall.www.domain.DbAdmin;
import com.snailcatmall.www.service.DbAdminService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.Date;

@Controller
public class UrlPageController {
    @Resource
    private DbAdminService dbAdminService ;
    @RequestMapping("/")
    public ModelAndView GoToHome(){
        ModelAndView mv = new ModelAndView();
        System.out.println("111111");
        DbAdmin dbAdmin = new DbAdmin(55,"444","778","2211","1102",new Date());

        dbAdminService.insertSave(dbAdmin);
        mv.setViewName("templates/index");
        return mv;
    }
    @RequestMapping("/testActions")
    public ModelAndView testActions(){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("templates/index");
        return mv;
    }
}
